package d0324;

public class TestReg {
    public static void main(String[] args) {
        String phoneNum = "13958965689";
        String regex = "^((13[0-9])|(15[^4])|(18[0,2,3,5,-9])|(17[0-8])|(147))\\d{8}$";
        boolean result = phoneNum.matches(regex);
        if (result){
            System.out.println("正确");
        }else{
            System.out.println("错误");
        }
    }
}
